// components/customHeader/customHeader.js
const app = getApp()
Component({
  externalClasses: ['i-class'],
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: ''
    },
    showNav: {
      type: Boolean,
      value: false
    },
    showNav1:{
      type: Boolean,
      value: false
    },
    showBack: {
      type: Boolean,
      value: false
    },
    showShare: {
      type: Boolean,
      value: true
    },
    showHome: {
      type: Boolean,
      value: false
    },
    openType: {
      type: String,
      value: ''
    },
    headerBack: {
      type: String,
      // value: 'rgba(255, 255, 255, 1) linear-gradient(315deg, rgba(255, 148, 97, 1) 0%, rgba(255, 209, 87, 1) 100%)'
      value: '#fff'

    },
    titleColor: {
      type: String,
      value: '#333'
    },
    navImage:{
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    navHeight: app.globalData.statusHeight
  },

  /**
   * 组件的方法列表
   */
  methods: {
    back () {
      wx.navigateBack({
        delta: 1
      })
    },
    toBack () {
      this.triggerEvent("back")
    },
    toShare () {
      this.triggerEvent("share")
    },
    toHome () {
      this.triggerEvent("home")
    }
  }
})